summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2023-03-24 05:19:43 +0100
committerGitHub <noreply@github.com>2023-03-24 05:19:43 +0100
commit7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0 (patch)
tree632f33e32988853831e45af61fefc90e59dec30b
parentMerge pull request #9971 from Morph1984/q (diff)
parentvulkan: fix more excessive waiting in scheduler (diff)
downloadyuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.tar
yuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.tar.gz
yuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.tar.bz2
yuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.tar.lz
yuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.tar.xz
yuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.tar.zst
yuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.zip
-rw-r--r--src/video_core/renderer_vulkan/vk_scheduler.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp
index c636a1625..55e699552 100644
--- a/src/video_core/renderer_vulkan/vk_scheduler.cpp
+++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp
@@ -65,12 +65,13 @@ void Scheduler::WaitWorker() {
DispatchWork();
// Ensure the queue is drained.
- std::unique_lock ql{queue_mutex};
- event_cv.wait(ql, [this] { return work_queue.empty(); });
+ {
+ std::unique_lock ql{queue_mutex};
+ event_cv.wait(ql, [this] { return work_queue.empty(); });
+ }
// Now wait for execution to finish.
- // This needs to be done in the same order as WorkerThread.
- std::unique_lock el{execution_mutex};
+ std::scoped_lock el{execution_mutex};
}
void Scheduler::DispatchWork() {